<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/message/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>政策风险指数软件--用户管理</title>
<%@ include file="/message/meta.jsp"%>
<link href="${ctx}/stylesheet/default.css" type="text/css" rel="stylesheet" />
<link href="${ctx}/javascript/validate/jquery.validate.css" type="text/css"
	rel="stylesheet" />
<script src="${ctx}/javascript/jquery.js" type="text/javascript"></script>
<script src="${ctx}/javascript/validate/jquery.validate.js"
	type="text/javascript"></script>
<script src="${ctx}/javascript/validate/messages_cn.js" type="text/javascript"></script>
<script>
	$(document).ready(function() {
		//聚焦第一个输入框
			$("#name").focus();
			//为inputForm注册validate函数
			$("#inputForm").validate(
					{
						rules : {
							name : {
								required : true,
								remote : "user!checkLoginName.action?oldName="
										+ encodeURIComponent('${name}')
							},
							nameCh : "required",
							password : {
								required : true,
								minlength : 3
							},
							passwordConfirm : {
								equalTo : "#password"
							}
						},
						messages : {
							name : {
								remote : "用户登录名已存在"
							},
							passwordConfirm : {
								equalTo : "输入与上面相同的密码"
							}
						}
					});
		});
</script>
</head>
<body>
<h3><s:if test="id == null">创建</s:if><s:else>修改</s:else>用户</h3>
<div id="inputContent">
<form id="inputForm" action="user!save.action" method="post"><input
	type="hidden" name="id" value="${id}" />
<table class="inputView">
	<tr>
		<td>登录名:</td>
		<td><input type="text" name="name" size="40" id="name"
			value="${name}" /></td>
	</tr>
	<tr>
		<td>用户名:</td>
		<td><input type="text" name="nameCh" size="40" value="${nameCh}" /></td>
	</tr>
	<tr>
		<td>密码:</td>
		<td><input type="password" id="password" name="password"
			size="40" value="${password}" /></td>
	</tr>
	<tr>
		<td>确认密码:</td>
		<td><input type="password" name="passwordConfirm" size="40"
			value="${password}" /></td>
	</tr>
	<tr>
		<td>是否有效:</td>
		<td><s:radio name="valid" list="#{true:'有效',false:'无效'}" listKey="key" listValue="value" theme="simple"/></td>
	</tr>
	<tr>
		<td>角色:</td>
		<td>
		<div style="word-break: break-all; width: 250px; overflow: auto;">
		<s:checkboxlist name="checkedRoleIds" list="roleList" listKey="id"
			listValue="name" theme="simple" /></div>
		</td>
	</tr>
	<tr>
		<td colspan="2"><input type="submit" value="提交" />&nbsp; <input
			type="button" value="返回" onclick="history.back();" /></td>
	</tr>
</table>
</form>
</div>
</body>
</html>